package io;

import java.io.*;

public class Copydome3 {
    public static void main(String[] args) throws IOException {
        File file = new File("./1.jpg");
        FileInputStream fis = new FileInputStream(file);
        FileOutputStream fos = new FileOutputStream("./cp3.jpg");
        int d;
        byte[] date =new byte[1024*10];
        long start = System.currentTimeMillis();
        while((d=fis.read(date))!=-1){
            fos.write(date,0,d);
        }
        long endtime = System.currentTimeMillis();
        long how=endtime-start;
        System.out.println("经历"+how+"毫秒，复制完毕！");
        fos.close();
        fis.close();
    }
}
